﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Symmetry.PluginSupport;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236

namespace Symmetry.Plugins.Validation
{
    public sealed partial class ValidateTextLen : UserControl, ICustomEditor, ICustomEditorEx
    {
        public ValidateTextLen()
        {
            this.InitializeComponent();
        }

        public void SetObject(object target)
        {
            DataContext = target;
        }

        public string GetDescription()
        {
            return "Finds all visible text blocks in the UI and annotates their length, highliting those not within the given threshold.";
        }

        public string GetFriendlyName()
        {
            return "Text Length Validator";
        }



        public int StringLengthThreshold
        {
            get { return (int)GetValue(StringLengthThresholdProperty); }
            set { SetValue(StringLengthThresholdProperty, value); }
        }

        // Using a DependencyProperty as the backing store for StringLengthThreshold.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty StringLengthThresholdProperty =
            DependencyProperty.Register("StringLengthThreshold", typeof(int), typeof(ValidateTextLen), new PropertyMetadata(0));



        public object SupportContent
        {
            get{return "Coming soon...";}
            set { }
        }


        public string Description
        {
            get
            {
                return "Appends a visual to all visible TextBlocks showing their current content length.";
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string FriendlyName
        {
            get
            {
                return "Text Length Validator";
            }
            set
            {
                throw new NotImplementedException();
            }
        }


        public string Publisher
        {
            get
            {
                return "EString Software 2012";
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string License
        {
            get
            {
                return "GNU (freeware with attribution)";
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string UniqueID
        {
            get
            {
                return "4816989B-B561-497F-BA26-4F0F3DA6453A";
            }
        }
    }
}
